<!DOCTYPE html>
<html>
	<head>
		<meta charset="UTF-8">
		<script src="https://cdn.bootcss.com/vue/2.2.2/vue.min.js"></script>
	<title>计算属性computed</title>
	</head>
	<body>
		<div id="app">
			<p>原始字符串:{{ message }}</p>
			<p>计算后翻转的字符串：{{reverseMessage}}</p>
			<p>使用方法翻转的字符串：{{reverseMessage2()}}</p>
		</div>
		<script>
			var vm = new Vue({
				el:"#app",
				data:{
					message:'Runoob!'
				},
				computed:{
					reverseMessage:function(){
					return this.message.split('').reverse().join('');
					}
				},
				methods:{
					reverseMessage2:function(){
						return this.message.split('').reverse().join('');
					}
				}
			})
		</script>
	</body>
</html>
